<template>
<div  v-loading="loading" element-loading-text="拼命加载中">

    <el-row>
    <!-- 搜索框 -->
    <el-col :span="24">
        <div class="search-wrapper">
          <ul class="search-box">
            <li><span class="filter-name">河道等级：</span>
              <el-select v-model="listQuery.riverLevel" placeholder="请选择" clearable style="width:130px" class="filter-item">
                <el-option v-for="item in riverTypeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictValue"/>
              </el-select></li>
            <li><span class="filter-name">河道名称：</span> <!--模糊搜索 --> 
              <el-input placeholder="河道名称" style="width:200px" v-model="listQuery.riverName" clearable></el-input></li>
             
            <li style="padding-left:10px;"><el-button style="vertical-align:middle;margin-top:-2px;" round size="mini" type="primary" @click="getList">查询</el-button></li>
          </ul>
        </div>
      </el-col>
       <!-- 按钮区 -->
      <el-col :span="24">
        <div class="button-wrapper">
          <el-button size="mini" type="primary" round @click="dialogAdd=true">增加</el-button>
          <el-button size="mini" type="danger" round  @click="batchEdit(-1)">删除</el-button>
        </div>
      </el-col>
    </el-row>
        <!-- 表格 -->
        <el-row>
            <el-col :span="24">
                <div class="data-wrapper">
                    <template v-if="tableData!=null">
                        <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
                                  @selection-change="handleSelectionChange">
                            <el-table-column type="selection" label="全选" width="55">
                            </el-table-column>
                            <el-table-column type="index" label="序号" width="160" :index="indexMethod">
                            </el-table-column>
                            <el-table-column prop="riverCode" label="河道编号" width="120">
                            </el-table-column>
                            <el-table-column prop="riverName" label="河道名称" width="120">
                            </el-table-column>
                            <el-table-column prop="riverLevel.name" label="河道等级" width="120">
                            </el-table-column>
                            <el-table-column prop="riverFlow" label="流经街道" width="120">
                            </el-table-column>
                            <el-table-column prop="isSub" label="是否分段" width="120">
                            </el-table-column>
                            <el-table-column label="开始经/纬度" width="180">
                                <template slot-scope="scope">
                                    <span>{{ scope.row.startLongitude}}/{{ scope.row.startLatitude}}</span>
                                </template>
                            </el-table-column>

                             <el-table-column label="结束经/纬度" width="180">
                                <template slot-scope="scope">
                                    <span>{{ scope.row.endLongitude}}/{{ scope.row.endLatitude}}</span>
                                </template>
                            </el-table-column>

                            <el-table-column prop="" label="GIS地图" width="120">
                            </el-table-column>
                              <!--单行信息的删改查 -->
                            <el-table-column fixed="right" label="操作" align="center" width="180" >
                                <template slot-scope="scope">
                                    <el-button title="查看" size="small" icon="el-icon-search" type="primary" circle
                                               @click="handleView(scope.$index, scope.row)"></el-button>
                                    <el-button title="编辑" size="small" icon="el-icon-edit" type="success" circle
                                               @click="handleEdit(scope.$index, scope.row)"></el-button>
                                    <el-button title="删除" size="small" icon="el-icon-delete" type="danger" circle
                                               @click="handleDel(scope.$index, scope.row)"></el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                </div>
            </el-col>
        </el-row>


    <!-- 底部按钮和分页 -->
    <el-row :gutter="20" v-if="dataCount" type="flex" justify="space-between" align="center" class="page-wrapper">
      <el-col :span="20">
        <div class="page-item">
          <el-pagination background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="listQuery.page"
          :page-sizes="pageSizes"
          :page-size="listQuery.limit"
          layout="total, sizes, prev, pager, next, jumper"
          :total="dataCount"/>
        </div>
      </el-col>
    </el-row>


    <!-- 弹出添加窗口区域 -->
    <el-dialog title="河道信息添加" :visible.sync="dialogAdd">
      <!-- <el-form :model="form" :rules="rules"> -->
        <el-form :model="form">
        <el-row :gutter="5">
         <el-col :span="12"> <!--下拉框 regId-regName-->
            <el-form-item label="所属区域" :label-width="formLabelWidth" prop="selectedAddress">
             <el-cascader class="width-all"
               :options="regData"
               :props="addProps"
               :change-on-select="true"
               v-model="form.selectedAddress"
               @change="handleChange"></el-cascader>
             </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="河长姓名" :label-width="formLabelWidth" prop="userName">
               <el-select v-model="form.userName" placeholder="请选择" clearable style="width:150px" class="filter-item">
                <el-option v-for="item in userName0ptions" :key="item.value" :label="item.userName" :value="item.userId"/>
              </el-select>
            </el-form-item>
          </el-col>
         </el-row>

         <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河长电话" :label-width="formLabelWidth" prop="userPhone">
              <el-input v-model="form.userPhone" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
         <el-col :span="12">
            <el-form-item label="是否分段" :label-width="formLabelWidth" prop="isSub">
              <el-radio-group v-model="form.isSub">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
            </el-form-item>
          </el-col>
          </el-row>

         <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河道状态" :label-width="formLabelWidth" prop="riverState">
              <el-select v-model="form.riverState" placeholder="请选择状态">
                <el-option label="正常" value="0"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="河段总长" :label-width="formLabelWidth"  prop="riverLength">
              <el-input  v-model="form.riverLength" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
       </el-row>
        <el-row :gutter="5">
           <el-col :span="12">
            <el-form-item label="河道编号" :label-width="formLabelWidth"  prop="riverCode">
              <el-input  v-model="form.riverCode" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="河道名称" :label-width="formLabelWidth"  prop="riverName">
              <el-input  v-model="form.riverName" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          </el-row>

          <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河道等级" :label-width="formLabelWidth"  prop="riverLevel">
               <el-select v-model="form.riverLevel" placeholder="请选择等级">
                  <el-option v-for="item in riverTypeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictValue"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="流经街道" :label-width="formLabelWidth" prop="riverFlow">
              <el-input v-model="form.riverFlow" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>



      <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="开始经度" :label-width="formLabelWidth" prop="startLongitude">
              <el-input v-model="form.startLongitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束经度" :label-width="formLabelWidth" prop="endLongitude">
              <el-input v-model="form.endLongitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

     <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="开始纬度" :label-width="formLabelWidth" prop="startLatitude">
              <el-input v-model="form.startLatitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束纬度" :label-width="formLabelWidth" prop="endLatitude">
              <el-input v-model="form.endLatitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!--
        <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="创建人" :label-width="formLabelWidth" prop="createUser">
              <el-input v-model="form.createUser" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="创建时间" :label-width="formLabelWidth" prop="createTime">
              <el-input v-model="form.createTime" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="更新人" :label-width="formLabelWidth" prop="updateUser">
              <el-input v-model="form.updateUser" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="更新时间" :label-width="formLabelWidth" prop="updateTime">
              <el-input v-model="form.updateTime" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        -->
        <el-row :gutter="5">
          <el-col :span="24">
             <el-button size="medium" type="primary" icon="el-icon-location">开始河段描点</el-button>
             <div class="form-map">
               地图位置预留区
             </div>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="medium" @click="dialogAdd = false">取 消</el-button>
        <el-button size="medium" type="primary" @click="insert()">确 定</el-button>
      </div>
    </el-dialog>


    <!-- 弹出修改窗口区域 -->
    <el-dialog title="河道信息修改" :visible.sync="dialogEdit">
     <!-- <el-form :model="form" :rules="rules"> -->
        <el-form :model="oneCol" v-if="oneCol">
        <el-row :gutter="5">
         <el-col :span="12"> <!--下拉框 regId-->
            <el-form-item label="所属区域" :label-width="formLabelWidth" prop="selectedAddress">
             <el-cascader class="width-all"
               :options="regData"
               :props="addProps"
               :change-on-select="true"
               v-model="oneCol.selectedAddress"
               @change="handleChange2"></el-cascader>
             </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="河长姓名" :label-width="formLabelWidth" prop="userName">
             <el-select v-model="form.userName" placeholder="请选择" clearable style="width:150px" class="filter-item">
                <el-option v-for="item in userName0ptions" :key="item.value" :label="item.userName" :value="item.userId"/>
              </el-select>
            </el-form-item>
          </el-col>
         </el-row>

         <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河长电话" :label-width="formLabelWidth" prop="userPhone">
              <el-input v-model="oneCol.userPhone" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="是否分段" :label-width="formLabelWidth" prop="isSub">
              <el-radio-group v-model="form.isSub">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
            </el-form-item>
          </el-col>
          </el-row>

         <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河道状态" :label-width="formLabelWidth" prop="riverState">
              <el-select v-model="form.riverState" placeholder="请选择状态">
                <el-option label="正常" value="0"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="河段总长" :label-width="formLabelWidth"  prop="riverLength">
              <el-input  v-model="oneCol.riverLength" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
       </el-row>
        <el-row :gutter="5">
           <el-col :span="12">
            <el-form-item label="河道编号" :label-width="formLabelWidth"  prop="riverCode">
              <el-input  v-model="oneCol.riverCode" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="河道名称" :label-width="formLabelWidth"  prop="river_name">
              <el-input  v-model="oneCol.riverName" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          </el-row>

          <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="河道等级" :label-width="formLabelWidth"  prop="riverLevel">
               <el-select v-model="oneCol.riverLevel" placeholder="请选择等级">
                  <el-option v-for="item in riverTypeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictValue"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="流经街道" :label-width="formLabelWidth" prop="riverFlow">
              <el-input v-model="oneCol.riverFlow" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>



      <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="开始经度" :label-width="formLabelWidth" prop="startLongitude">
              <el-input v-model="oneCol.startLongitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束经度" :label-width="formLabelWidth" prop="endLongitude">
              <el-input v-model="oneCol.endLongitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

     <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="开始纬度" :label-width="formLabelWidth" prop="startLatitude">
              <el-input v-model="oneCol.startLatitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束纬度" :label-width="formLabelWidth" prop="endLatitude">
              <el-input v-model="oneCol.endLatitude" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!--
        <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="创建人" :label-width="formLabelWidth" prop="createUser">
              <el-input v-model="oneCol.createUser" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="创建时间" :label-width="formLabelWidth" prop="createTime">
              <el-input v-model="oneCol.createTime" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="5">
          <el-col :span="12">
            <el-form-item label="更新人" :label-width="formLabelWidth" prop="updateUser">
              <el-input v-model="oneCol.updateUser" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="更新时间" :label-width="formLabelWidth" prop="updateTime">
              <el-input v-model="oneCol.updateTime" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        -->
        <el-row :gutter="5">
          <el-col :span="24">
             <el-button size="medium" type="primary" icon="el-icon-location">开始河段描点</el-button>
             <div class="form-map">
               地图位置预留区
             </div>
          </el-col>
        </el-row>

      </el-form>
     <div slot="footer" class="dialog-footer">
        <el-button size="medium" @click="dialogEdit = false">取 消</el-button>
        <el-button size="medium" type="primary" @click="update()">确 定</el-button>
      </div>
    </el-dialog>


    <!--弹出查看信息框 -->
    <el-dialog title="河道信息详细查看" :visible.sync="dialogShow">
      <el-form v-if="oneCol">
          <el-row :gutter="10">
            <el-col :span="12">
            所属区域： {{oneCol.regId}}
            </el-col>
            <el-col :span="12">
            河长姓名： {{oneCol.userName}}
            </el-col>
          </el-row>

          <el-row :gutter="10">
            <el-col :span="12">
            河长电话： {{oneCol.userPhone}}
            </el-col>
            <el-col :span="12">
            是否分段： {{oneCol.isSub}}
            </el-col>
          </el-row>

          <el-row :gutter="10">
            <el-col :span="12">
            河道状态： {{oneCol.riverState}}
            </el-col>
            <el-col :span="12">
            河道总长： {{oneCol.riverLength}}
            </el-col>
          </el-row>

          <el-row :gutter="10">
            <el-col :span="12">
            河道编号： {{oneCol.riverCode}}
            </el-col>
            <el-col :span="12">
            河道名称： {{oneCol.riverName}}
            </el-col>
          </el-row>

          <el-row :gutter="10">
              <el-col :span="12">
              河道等级： {{oneCol.riverLevel}}
              </el-col>
              <el-col :span="12">
              流经街道： {{oneCol.riverFlow}}
              </el-col>
          </el-row>
            <el-row :gutter="10">
            <el-col :span="12">
            开始经度： {{oneCol.startLongitude}}
            </el-col>
            <el-col :span="12">
            结束经度： {{oneCol.endLongitude}}
            </el-col>
          </el-row>


            <el-row :gutter="10">
            <el-col :span="12">
            开始纬度： {{oneCol.startLatitude}}
            </el-col>
            <el-col :span="12">
            结束纬度： {{oneCol.endLatitude}}
            </el-col>
          </el-row>

          <el-row :gutter="10">
            <el-col :span="12">
            创建人： {{oneCol.createUser}}
            </el-col>
            <el-col :span="12">
            创建时间： {{oneCol.createTime}}
            </el-col>
          </el-row>

            <el-row :gutter="10">
            <el-col :span="12">
            更新人： {{oneCol.updateUser}}
            </el-col>
            <el-col :span="12">
            更新时间： {{oneCol.updateTime}}
            </el-col>
         </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="medium" @click="dialogShow = false">取 消</el-button>
        <el-button size="medium" type="primary" @click="dialogShow = false">确 定</el-button>
      </div>
    </el-dialog>


  </div>
</template>
<script>
export default {
  data() {
    return {
      //搜索框的下拉框
      riverTypeOptions: [],
      //用户下拉列表
      userName0ptions:[],
     riverName0ptions: [{
                    value: '长江2号',
                    label: '长江2号'
                }, {
                    value: '长江1号',
                    label: '长江1号'
                }],

      tableData: [],
      //默认数据总数
      dataCount: 100,
      pageSizes: [5, 10, 20, 30, 40],
      //查询条件
      listQuery: {
        page: 1,//当前页
        limit: 5//每页大小
      },
      listSelect: [],
      dialogAdd: false,
      dialogShow: false,
      dialogEdit: false,
      loading: false,
      dataIndex:0,
      form: {},
      oneCol: {},
      addProps: {
        label:'regName',
        value:'regId',
        children: 'children'
      },
      //添加/删除的表单校验信息
     /* rules: {
        riverLevel: [
          { required: true, message: "请输入河道类型", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
        ],
        riverName: [
          { required: true, message: "请输入河道名称", trigger: "change" }
        ],
       */
      formLabelWidth: "100px"
    };
  },


  created() {
    //this.getList();
  },
  mounted() {
    this.getList();
    this.getRiverTypeOptions();
  },
  computed:{
      regData:function(){
        return this.$store.state.dropTree
      }
    },
  updated() {},
  destroyed() {},
  methods: {
    //列表查询
    getList() {
      this.loading = true;
      this.getRequest("/api/rcs/rivers", this.listQuery)
        .then(res => {
          var data = res.data;
          if (data.status == 200) {
            this.tableData = data.data;
            this.dataCount = data.count;
          } else {
            this.$message.error(data.msg);
          }
          this.loading = false;
        })
        .catch(error => {

          //错误信息
           this.$message.error(error);

        });
    },
    getRiverTypeOptions(){
        this.getDictionary({types:["RIVER_TYPE"]}).then(res => {
          var data = res.data;
          if (data.status == 200) {
           this.riverTypeOptions = data.data["RIVER_TYPE"];
          } else {
             this.$message.error(data.msg);
          }
        })
        .catch(error => {
          //错误信息
           this.$message.error(error);
        });
    },


    getUserNameOptions(value){
        this.getRequest("/api/user/regin/list", {regId: value}).then(res => {
          //console.log(res)
          var data = res.data;
          console.log(data.data)
          if (data.status == 200) {

           this.userName0ptions = data.data;

          } else {
             this.$message.error(data.msg);
          }
        })
        .catch(error => {
          //错误信息
           this.$message.error(error);
        });
    },

    //新增
    insert() {
      this.postRequest("/api/rcs/river/addRiver", this.form)  //新增的url
        .then(res => {
          var data = res.data;
          if (data.status == 200) {
            this.$message.success(data.msg);
            this.dialogAdd = false;
            this.getList();
            this.form = {};
          } else {
             this.$message.error(data.msg);
          }
        })
        .catch(error => {
          //错误信息
           this.$message.error(error);
        });
    },


    //修改
    update() {
      this.postRequest("/api/rcs/river/updateRiver", this.oneCol)
        .then(res => {
          var data = res.data;
          if (data.status == 200) {
            this.$message.success(data.msg);
            this.dialogEdit = false;
            this.getList();
            this.oneCol = {};
          } else {
            this.$message.error(data.msg);
          }
        })
        .catch(error => {
          //错误信息
           this.$message.error(error);
        });
    },
    //批量删除
     batchEdit(val){//批量编辑
                if(this.listSelect.length<=0){
                    this.$message.warning("请选择一条数据");
                    return;
                }
                var strArr=[];
                for(var i=0;i<this.listSelect.length;i++){
                    strArr.push(this.listSelect[i].riverId)
                }
                var submitData={//前面三个参数分别是 表名，状态字段名，id字段名
                    tableName:'b_river',
                    tableCol:'river_state',//status 为状态值 （0：正常  9：停用 -1：删除）
                    tableId:'river_id',
                    status:val,
                    ids:strArr//ids 为需要批量操作的 id数组
                }
                this.$confirm("确认批量操作？").then(()=> {
                    this.putRequest("/api/common/batch", submitData)
                        .then(sres => {
                            var data = res.data;
                            if (data.status == 200) {
                                this.$message.success(data.msg);
                                this.getList();
                            } else {
                                this.$message.error(data.msg);
                            }
                        }).catch(error => {
                            //错误信息
                            this.$message.error(data.msg);
                        });
                });
            },


    handleSelectionChange(val) {
      this.listSelect = val;
    },
    indexMethod(index) {
      return (index+1)+(this.listQuery.page-1)*this.listQuery.limit;
    },
    //每页个数改变
    handleSizeChange(size) {
      this.listQuery.limit = size;
      this.listQuery.page = 1;
      this.dataIndex=0;
      this.getList();
    },
    //当前页改变
    handleCurrentChange(currentPage) {
      this.listQuery.page = currentPage;
      this.dataIndex=this.listQuery.page*this.listQuery.limit;
      this.getList();
    },


     //查看操作
   handleView(index, row) {
       this.dialogShow = true;
       debugger

       this.oneCol = row;
       this.oneCol.riverLevel=row.riverLevel.name;
       this.oneCol.regId=row.regId.name;


     },
    //显示编辑弹窗
    handleEdit(index, row) {
      let rowData = Object.assign({},row);
      this.oneCol = rowData;
      this.oneCol.selectedAddress="";
      this.oneCol.riverLevel = rowData.riverLevel.code;
      this.oneCol.regId = rowData.regId.code;
        var regId =  this.oneCol.regId;

        //区域下拉列表数据初始化
        var prefix = regId.substr(0,1);

        var codeValue = regId.substr(1);

        var count = codeValue.length/2;
        var subLen = 2;
        var codeArr=[];
        for(var i=0;i<count;i++){
          codeArr.push(prefix+codeValue.substr(0,subLen));
           subLen = subLen+2;
        }
         this.oneCol.selectedAddress = codeArr;
      this.dialogEdit = true;
    },

 //单个删除
  handleDel(index,row){ //逻辑删除handleDel(row,index)
                this.$confirm("确认删除？").then(_ => {
                    this.deleteRequest("/api/rcs/river/deleteRiver", {riverId: row.riverId}).then((res) => {
                        var data = res.data;
                        this.$message.success("删除成功");
                        this.getList();
                    }).catch((error) => {
                        this.$message.error(error);
                        });
                }).catch(() => {
                    this.$message("取消删除");
                });
            },
handleChange(value) {
  console.log(value[value.length-1])
  var that=this
    //this.oneCol.selectedAddress=value
      // this.form.regId=value[value.length-1];
      // var regionId= this.form.regId;

   that.getUserNameOptions(value[value.length-1]);
   
    },



  handleChange2(value) {
  console.log(value[value.length-1])
  var that=this
    //this.oneCol.selectedAddress=value
      // this.form.regId=value[value.length-1];
      // var regionId= this.form.regId;
   that.getUserNameOptions(value[value.length-1]);
   
    }
    
  }
};
</script>
<style scoped>
</style>

